home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / AT1700 / OEMSETUP.INF < prev   
INI File  |  1996-07-31  |  48KB  |  1,638 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADAM.INF
  4. ;
  5. ;       AT1700 Family network card and driver SETUP INF file.
  6. ;
  7. ; History:
  8. ;***********************************************************************
  9.  
  10. ;-----------------------------------------------------------------------
  11. ; OPTION TYPE
  12. ; -----------
  13. ; This identifies the Option type we are dealing with.  The different
  14. ; possible types are:
  15. ;
  16. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  17. ;
  18. ;  Types specific to networking:
  19. ;
  20. ; NetAdapter,        a netcard / adapter combination or just a netcard
  21. ; NetDriver,         just a netcard driver
  22. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  23. ; NetService,        an NT networking service
  24. ; NetWork,           a complete network ensemble.
  25. ; NetProvider        a complete network which supports NT MPR protocol
  26. ;-----------------------------------------------------------------------
  27.  
  28. [Identification]
  29.     OptionType = NetAdapter
  30.  
  31. ;-----------------------------------------------------------------------
  32. ; PlatformsSupported
  33. ; ------------------
  34. ; This identifies the platforms supported by the adapter card.
  35. ; Possible types are:
  36. ;
  37. ; ISA and EISA
  38. ;-----------------------------------------------------------------------
  39.  
  40. [PlatformsSupported]
  41.     ISA
  42.     EISA
  43.  
  44. ;-----------------------------------------------------------------------
  45. ; OPTION LIST
  46. ; -----------
  47. ; This section lists the OEM Option key names.  These keys are locale
  48. ; independent and used to represent the option in a locale independent
  49. ; manner.
  50. ;
  51. ;-----------------------------------------------------------------------
  52.  
  53. [Options]
  54.     AT1700
  55.  
  56. ;***********************************************************************
  57. ; CONSTANTS FOR USING DIALOGS
  58. ;***********************************************************************
  59.  
  60. [FileConstants]
  61.  
  62.  
  63. GenericInfVersion  = " v2.0"
  64. GenericAdapterName = " ATI AT1700 Ethernet Adapter"
  65. GenericDriverName  = "ATI AT1700 Ethernet Adapter Driver"
  66. GenericSysName     = "at1700.sys"
  67. GenericName        = "AT1700"
  68.  
  69.  
  70.  
  71. ;
  72. ;  File names, etc.
  73. ;
  74. UtilityInf      = "UTILITY.INF"
  75. ParamInf        = "NCPARAM.INF"
  76. subroutineinf   = "SUBROUTN.INF"
  77. SoftwareType    = "driver"
  78. Exit_Code       = 0
  79.  
  80. ;
  81. ; EventLog Message File
  82. ;
  83. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  84. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  85.  
  86. ; Product Info
  87. ;
  88. Manufacturer    = "Microsoft"
  89. ProductMajorVersion     = "3"
  90. ProductMinorVersion     = "1"
  91. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  92.  
  93. ;
  94. ; Software
  95. ;
  96. ProductSoftwareName     = "AT1700"
  97. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\"$(GenericSysName)
  98. NetRuleSoftwareType     = "at1700Sys ndisDriver at1700Driver"
  99.  
  100. NetRuleSoftwareUse      = $(SoftwareType)
  101. NetRuleSoftwareBindForm = """at1700Sys"" yes no container"
  102.  
  103. NetRuleSoftwareClass    = {"at1700Driver basic"}
  104. NetRuleSoftwareBindable = {"at1700Driver at1700Adapter non exclusive 100"}
  105. ;
  106. ; Hardware
  107. ;
  108. ProductHardwareName        = "AT1700"
  109. NetRuleHardwareType        = "at1700 at1700Adapter"
  110. NetRuleHardwareBindForm    = " yes yes container"
  111. NetRuleHardwareClass       = {"at1700Adapter basic"}
  112.  
  113.  
  114.  
  115. ;
  116. ; Registry Key
  117. ;
  118. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  119. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  120.  
  121.  
  122. [GeneralConstants]
  123. ;
  124. ;  Program flow control variables.
  125. ;
  126. from      = ""
  127. to        = ""
  128. ;
  129. ;  Return codes; Exit_Code is set to one of these
  130. ;
  131. ExitCodeOk     = 0
  132. ExitCodeCancel = 1
  133. ExitCodeFatal  = 2
  134.  
  135. KeyNull         = ""
  136. MAXIMUM_ALLOWED   = 33554432
  137. RegistryErrorIndex = NO_ERROR
  138. KeyProduct      = ""
  139. KeyParameters   = ""
  140.  
  141. TRUE            = 1
  142. FALSE           = 0
  143. NoTitle         = 0
  144.  
  145. ExitState   = "Active"
  146. OldVersionExisted = $(FALSE)
  147.  
  148. DriverPath      = $(!STF_NTPATH)\drivers
  149.  
  150. [date]
  151.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  152.     ; Minute, Second }
  153.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  154.  
  155.  
  156. ;---------------------------------------------------------------------------
  157. ; 1. Identify
  158. ;
  159. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  160. ;                as we are choosing currently.
  161. ;
  162. ; INPUT:         None
  163. ;
  164. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  165. ;                $($R1): Option Type (COMPUTER ...)
  166. ;                $($R2): Diskette description
  167. ;---------------------------------------------------------------------------
  168.  
  169. [Identify]
  170.     ;
  171.     ;
  172.     read-syms Identification
  173.  
  174.     set Status     = STATUS_SUCCESSFUL
  175.     set Identifier = $(OptionType)
  176.     set Media      = #("Source Media Descriptions", 1, 1)
  177.  
  178.     Return $(Status) $(Identifier) $(Media)
  179.  
  180. ;------------------------------------------------------------------------
  181. ; 2. ReturnOptions:
  182. ;
  183. ; DESCRIPTION:   To return the option list supported by this INF and the
  184. ;                localised text list representing the options.
  185. ;
  186. ;
  187. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  188. ;
  189. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  190. ;                                STATUS_NOLANGUAGE
  191. ;                                STATUS_FAILED
  192. ;                                STATUS_NOTSUPPORTED
  193. ;
  194. ;                $($R1): Option List
  195. ;                $($R2): Option Text List
  196. ;------------------------------------------------------------------------
  197.  
  198. [ReturnOptions]
  199.     ;
  200.     ;
  201.     set Status        = STATUS_FAILED
  202.     set OptionList     = {}
  203.     set OptionTextList = {}
  204.  
  205.     ;
  206.     ; Check if the language requested is supported
  207.     ;
  208.     set LanguageList = ^(LanguagesSupported, 1)
  209.     Ifcontains(i) $($0) in $(LanguageList)
  210.         ;
  211.         ; Check if the platforms requested is supported
  212.         ;
  213.         ifstr(i) $($1) == ""
  214.                         goto returnoptions
  215.         endif
  216.  
  217.         set PlatformList = ^(PlatformsSupported, 1)
  218.         Ifcontains(i) $($1) in $(PlatformList)
  219.                         goto returnoptions
  220.         else
  221.                         set Status = STATUS_NOTSUPPORTED
  222.                         goto finish_ReturnOptions
  223.         endif
  224.     else
  225.                 set Status = STATUS_NOLANGUAGE
  226.                 goto finish_ReturnOptions
  227.     endif
  228.  
  229.     ;
  230.     ; form a list of all the options and another of the text representing
  231.     ;
  232.  
  233. returnoptions = +
  234.     set OptionList     = ^(Options, 1)
  235.     set OptionTextList = ^(OptionsText$($0), 1)
  236.     set Status         = STATUS_SUCCESSFUL
  237.  
  238. finish_ReturnOptions = +
  239.     Return $(Status) $(OptionList) $(OptionTextList)
  240.  
  241. ;------------------------------------------------------------------------
  242. ;
  243. ; InstallOption:
  244. ;
  245. ;      This section is shelled to by main installation processing
  246. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  247. ;
  248. ;
  249. ; FUNCTION:  To copy files representing Options
  250. ;            To configure the installed option
  251. ;            To update the registry for the installed option
  252. ;
  253. ; INPUT:     $($0):  Language to use
  254. ;            $($1):  OptionID to install
  255. ;            $($2):  SourceDirectory
  256. ;            $($3):  AddCopy  (YES | NO)
  257. ;            $($4):  DoCopy   (YES | NO)
  258. ;            $($5):  DoConfig (YES | NO)
  259. ;
  260. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  261. ;                            STATUS_NOLANGUAGE |
  262. ;                            STATUS_USERCANCEL |
  263. ;                            STATUS_FAILED
  264. ;
  265. ;------------------------------------------------------------------------
  266. [InstallOption]
  267.     ;
  268.     ; Set default values for
  269.     ;
  270.     set Status   = STATUS_FAILED
  271.     ;
  272.     ; extract parameters
  273.     ;
  274.     set Option   = $($1)
  275.     set SrcDir   = $($2)
  276.     set AddCopy  = $($3)
  277.     set DoCopy   = $($4)
  278.     set DoConfig = $($5)
  279.  
  280.     ;
  281.     ; Check if the language requested is supported
  282.     ;
  283.     set LanguageList = ^(LanguagesSupported, 1)
  284.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  285.         Return STATUS_NOLANGUAGE
  286.     endif
  287.  
  288.     set-subst LF = "\n"
  289.  
  290.     read-syms GeneralConstants
  291.     read-syms FileConstants
  292.  
  293.     read-syms DialogConstants$(!STF_LANGUAGE)
  294.     ifstr(i) $(!NTN_Origination) == "NCPA"
  295.         set Continue = $(OK)
  296.     endif
  297.     read-syms FileConstants$(!STF_LANGUAGE)
  298.  
  299.     detect date
  300.  
  301.     set-title  $(FunctionTitle)
  302.  
  303.     set to   = Begin
  304.     set from = Begin
  305. ;
  306. ;  Assume all is well.
  307. ;
  308.     set CommonStatus = STATUS_SUCCESSFUL
  309.  
  310.     EndWait
  311.  
  312. ;
  313. ;   Set up the operation-mode-based variables and gaily welcome
  314. ;   the user.  If the "install mode" variable is improperly set,
  315. ;   assume this is a new installation.
  316. ;
  317.  
  318. Begin = +
  319.     Set ActivateDetection = FALSE
  320.  
  321.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  322.         set StartLabel = removeadapter
  323.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  324.         set StartLabel = UpgradeSoftware
  325.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  326.         set StartLabel = bindingadapter
  327.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  328. ;        set ActivateDetection = TRUE
  329.         set StartLabel = configureadapter
  330.         ;
  331.         ;   You cannot config the software component
  332.         ;
  333.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  334.             Debug-Output "Cannot configure the AT1700 driver software."
  335.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  336.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  337.                 Debug-Output "ShellCode error: cannot get an error string."
  338.                 goto ShellCodeError
  339.             endif
  340.             set Error = $($R0)
  341.             set from = end
  342.             set to = end
  343.             goto nonfatalinfo
  344.         endif
  345.     else
  346. ;        set ActivateDetection = TRUE
  347.         set StartLabel = installadapter
  348.         set OEM_ABANDON_OPTIONS = {}
  349.         set OEM_ABANDON_SOFTWARE = FALSE
  350.         set OEM_ABANDON_ON = TRUE
  351.     endif
  352.  
  353.  
  354.  
  355.     ;  set the default values
  356.  
  357.     ; IRQ Level = 5
  358.     set IRQValue = *($(IRQList), 3)
  359.  
  360.     ; IOBase Address = 0x300
  361.     set IOBaseAddrValue = *($(IOBaseAddrList), 5)
  362.  
  363.     ; DMAChannel = 5
  364.     set DMAChannelValue = *($(DMAChannelList), 2)
  365.     
  366.     set RadioIn  = {7} 
  367.     set BusScanValue = "ALL" 
  368.     set LED0Value = *($(LEDList), 1)
  369.     set LED1Value = *($(LEDList), 1)
  370.     set LED2Value = *($(LEDList), 1)
  371.     set LED3Value = *($(LEDList), 1)
  372.     set TPValue = 1
  373.     set FullDuplexValue = *($(FullDuplexList), 1)
  374.     set MediaTypeValue = *($(MediaTypeList), 2)
  375.  
  376.     Set from = $(fatal)
  377.     Set to = $(fatal)
  378.     Goto $(StartLabel)
  379.  
  380. ;-----------------------------------------------
  381. ; Installation Section
  382. ;-----------------------------------------------
  383.  
  384. installadapter = +
  385. ;
  386. ;   First, check whether the same version of the software exists
  387. ;
  388.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  389.  
  390.     Ifstr $(KeyProduct) != $(KeyNull)
  391.         ;
  392.         ; Same version already existed in the local machine
  393.         ; Popup the dialog and ask the user whether he wants to continue
  394.         ;
  395.         CloseRegKey $(KeyProduct)
  396.  
  397.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  398.            ;
  399.            ; Cannot Install the same software again
  400.            ;
  401.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  402.                $(ProductVersion)
  403.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  404.                Debug-Output "ShellCode error: cannot get an error string."
  405.                goto ShellCodeError
  406.            endif
  407.  
  408.            goto end
  409.         else
  410.            ;
  411.            ; Add a new adapter card?
  412.            ;
  413.            Shell $(UtilityInf), CardExistedDlg
  414.  
  415.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  416.                Debug-Output "ShellCode error: cannot get an error string."
  417.                goto ShellCodeError
  418.            endif
  419.  
  420.            ifstr(i) $($R1) != "OK"
  421.                goto end
  422.            endif
  423.            set OldVersionExisted = $(TRUE)
  424.         endif
  425.     endif
  426.  
  427.     ; If we're installing a second time, don't re-copy the help file
  428.     ; !!!
  429.     ifint $(OldVersionExisted) == $(FALSE)
  430.     ifstr(i) $(!NTN_InstallMode) == "install"
  431.        Ifstr(i) $(DoCopy) == "YES"
  432.         Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  433.           
  434.         Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  435.             Goto ShellCodeError
  436.         Else-Ifstr(i) $($R0) == STATUS_FAILED
  437.             Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  438.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  439.             goto ShellCodeError
  440.             endif
  441.             set Error = $($R0)
  442.             Goto fatal
  443.         Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  444.             Goto successful
  445.         Endif
  446.     
  447.         Set SrcDir = $($R1)
  448.         endif
  449.  
  450.         install "Install-Helpfile"
  451.     endif
  452.     endif
  453.  
  454.     SetHelpFile "at1700.hlp" 1 11
  455.  
  456. ;
  457. ;  dll load addition
  458. ;
  459.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  460.  
  461.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  462.         Goto ShellCodeError
  463.     Else-Ifstr(i) $($R0) == STATUS_FAILED
  464.         Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  465.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  466.             goto ShellCodeError
  467.         endif
  468.         set Error = $($R0)
  469.         Goto fatal
  470.     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  471.         Goto successful
  472.     Endif
  473.  
  474.     Set SrcDir = $($R1)
  475.  
  476.     install "Install-Dll"
  477.  
  478.     goto adaptersetup
  479.  
  480. ;-----------------------------------------------
  481. ; Configuration Section
  482. ;-----------------------------------------------
  483. ;
  484. ;   Get the current values of all the parameters
  485. ;
  486. configureadapter = +
  487.  
  488.     SetHelpFile "at1700.hlp" 1 11
  489.  
  490.     Ifstr $(KeyProduct) == $(KeyNull)
  491.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  492.         Ifstr $(KeyProduct) == $(KeyNull)
  493.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  494.             Debug-Output "Cannot find component product key"
  495.             goto fatalregistry
  496.         Endif
  497.     Endif
  498.  
  499.     ;
  500.     ; Get the other parameters;  they're attached to the service parameters key
  501.     ;
  502.     Debug-Output "INF: Shelling to FindService"
  503.     Shell $(UtilityInf) FindService, $(KeyProduct)
  504.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  505.         Debug-Output "INF: FindService shell failure"
  506.         Goto ShellCodeError
  507.     Endif
  508.     Ifstr(i) $($R0) != NO_ERROR
  509.         Debug-Output "INF: FindService Shell error: "$($R0)
  510.         Goto fatalregistry
  511.     endif
  512.  
  513.     Set KeyParameters = $($R2)
  514.  
  515.     ;
  516.     ;  We don't need the services key, so close it.
  517.     ;
  518.     CloseRegKey $($R1)
  519.  
  520.     Ifstr $(KeyParameters) == $(KeyNull)
  521.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  522.         Debug-Output "Cannot find component service"
  523.         goto fatalregistry
  524.     endif
  525.  
  526.     set OldVersionExisted = $(TRUE)
  527.  
  528.     set ValueName = ""
  529.     set ValueData = ""
  530.     set ValueStr  = ""
  531.     set ValueList = {}
  532.  
  533.     ;
  534.     ; Get the old values
  535.     ;
  536.     EnumRegValue $(KeyParameters) ValueList
  537.  
  538.     ForListDo $(ValueList)
  539.         set ValueItem = $($)
  540.         set ValueName = *($(ValueItem),1)
  541.         set ValueData = *($(ValueItem),4)
  542.         ifstr(i) $(ValueName) == "IOBaseAddress"
  543.             set IOBaseAddrIndex = $(ValueData)
  544.         endif
  545.  
  546.     EndForListDo
  547.  
  548.                  
  549.     Ifint $(TPValue) == 0
  550.         Set CheckItemsIn = {"OFF"}
  551.     Else
  552.         Set CheckItemsIn = {"ON"}
  553.     Endif                
  554.     
  555.     ; set the Radio Buttons depending on the bustype in the reg.
  556.     
  557.     Ifstr $(BusScanValue) == "PCI"
  558.         Set RadioIn = {1}
  559.     Else-Ifstr $(BusScanValue) == "PNP"
  560.         Set RadioIn = {2}
  561.     Else-Ifstr $(BusScanValue) == "VESA"
  562.         Set RadioIn = {3}
  563.     Else-Ifstr $(BusScanValue) == "ISA"
  564.         Set RadioIn = {4}
  565.     Else-Ifstr $(BusScanValue) == "PCI1"
  566.         Set RadioIn = {5}
  567.     Else-Ifstr $(BusScanValue) == "PCI2"
  568.         Set RadioIn = {6}
  569.     Else-Ifstr $(BusScanValue) == "ALL"
  570.         Set RadioIn = {7}
  571.     Else-Ifstr $(BusScanValue) == ""
  572.         Set RadioIn = {7}
  573.     Endif
  574.  
  575.     Debug-Output $(InfName)" TP is "$(TPValue)
  576.                             
  577.  
  578.     set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  579.     ifstr(i) $(IRQValue) == ""
  580.         set IRQValue = *($(IRQList), 3)
  581.     endif
  582.  
  583.     Debug-Output $(InfName)" IRQ_Level is "$(IRQValue)
  584.  
  585.     set DMAChannelValue = *($(DMAChannelList), ~($(DMAChannelValues),$(DMAChannelIndex)))
  586.     ifstr(i) $(DMAChannelValue) == ""
  587.         set DMAChannelValue = *($(DMAChannelList), 2)
  588.     endif
  589.  
  590.     Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  591.  
  592.     set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  593.  
  594.     ifstr(i) $(IOBaseAddrValue) == ""
  595.         set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  596.     endif
  597.  
  598.     Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  599.  
  600.     set LED0Value = *($(LEDList), ~($(LEDValues),$(LED0Index)))
  601.  
  602.     ifstr(i) $(LED0Value) == ""
  603.         set LED0Value = *($(LEDList), 1)
  604.     endif
  605.  
  606.     Debug-Output $(InfName)" LED0 is "$(LED0Value)
  607.  
  608.     set LED1Value = *($(LEDList), ~($(LEDValues),$(LED1Index)))
  609.  
  610.     ifstr(i) $(LED1Value) == ""
  611.         set LED1Value = *($(LEDList), 1)
  612.     endif
  613.  
  614.     Debug-Output $(InfName)" LED1 is "$(LED1Value)
  615.  
  616.     set LED2Value = *($(LEDList), ~($(LEDValues),$(LED2Index)))
  617.  
  618.     ifstr(i) $(LED2Value) == ""
  619.         set LED2Value = *($(LEDList), 1)
  620.     endif
  621.  
  622.     Debug-Output $(InfName)" LED2 is "$(LED0Value)
  623.  
  624.     set LED3Value = *($(LEDList), ~($(LEDValues),$(LED3Index)))
  625.  
  626.     ifstr(i) $(LED3Value) == ""
  627.         set LED3Value = *($(LEDList), 1)
  628.     endif
  629.  
  630.     Debug-Output $(InfName)" LED3 is "$(LED3Value)
  631.  
  632.     set FullDuplexValue = *($(FullDuplexList), ~($(FullDuplexValues),$(FullDuplexIndex)))
  633.  
  634.     ifstr(i) $(FullDuplexValue) == ""
  635.         set FullDuplexValue = *($(FullDuplexList), 1)
  636.     endif
  637.  
  638.     Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  639.  
  640.  
  641.     set MediaTypeValue = *($(MediaTypeList), ~($(MediaTypeValues),$(MediaTypeIndex)))
  642.  
  643.     ifstr(i) $(MediaTypeValue) == ""
  644.         set MediaTypeValue = *($(MediaTypeList), 2)
  645.     endif
  646.  
  647.     Debug-Output $(InfName)" Media Type is "$(MediaTypeValue)
  648.  
  649.  
  650.     ;  Save the settings as they were read from the Registry.
  651.  
  652. ;    Shell $(ParamInf) Param_SaveValues
  653. ;    Set CurrParamSettings = $($R0)
  654. ;
  655. ;   Put up the adapter configuration dialog if necessary.
  656. ;
  657. ;   Note that $(CurrParamSettings) has the old known parameter values.
  658. ;
  659. adaptersetup = +
  660.  
  661. ;    Shell "" DebugConfiguration "before displaying dialog"
  662.  
  663.     Set from = adapteroptions
  664.  
  665.  
  666. adapteroptions = +
  667.  
  668.     LoadLibrary "Disk 1" .\$(DialogDllName) hLib
  669.  
  670.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  671.  
  672.     Debug-Output $(InfName)" Bus is "$(BusScanValue)
  673.     Debug-Output $(InfName)" TP is "$(TPValue)
  674.     Debug-Output $(InfName)" LED0 is "$(LED0Value)
  675.     Debug-Output $(InfName)" LED1 is "$(LED1Value)
  676.     Debug-Output $(InfName)" LED2 is "$(LED2Value)
  677.     Debug-Output $(InfName)" LED3 is "$(LED3Value)
  678.     Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  679.     Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  680.     Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  681.     Debug-Output $(InfName)" Media Type is "$(MediaTypeValue)
  682.  
  683.  
  684.     ui start "InputDlg"  $(hLib)
  685.  
  686.     set ExitButton      = $(ButtonPressed)
  687.  
  688.     Debug-Output " ButtonPressed "$(ButtonPressed)
  689.  
  690.  
  691.     FreeLibrary $(hLib)
  692.  
  693.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  694.                 set IOBaseAddrIndex = $(Combo1Out)
  695.                 set IRQValueIndex = $(Combo2Out)
  696.                 set DMAChannelIndex = $(Combo3Out)
  697. ;                set FullDuplexIndex = $(Combo4Out)
  698.                 set MediaTypeIndex = $(Combo4Out)
  699.                 set LED0Index = $(Combo5Out)
  700.                 set LED1Index = $(Combo6Out)
  701.                 set LED2Index = $(Combo7Out)
  702.                 set LED3Index = $(Combo8Out)
  703.                 set ExitButton = $(ButtonPressed)
  704.  
  705.                 set BusIndex = *($(RadioOut),1)
  706.  
  707.                 Debug-Output $(InfName)" Busindex is "$(BusIndex)
  708.  
  709.                 Ifint $(BusIndex) == 1
  710.                     Set BusScanValue = "PCI"
  711.                 else-Ifint $(BusIndex) == 2
  712.                     Set BusScanValue = "PNP"
  713.                 else-Ifint $(BusIndex) == 3
  714.                     Set BusScanValue = "VESA"
  715.                 else-Ifint $(BusIndex) == 4
  716.                     Set BusScanValue = "ISA"
  717.                 else-Ifint $(BusIndex) == 5
  718.                     Set BusScanValue = "PCI1"
  719.                 else-IFint $(BusIndex) == 6
  720.                     Set BusScanValue = "PCI2"
  721.                 else-Ifint $(BusIndex) ==  7
  722.                     Set BusScanValue = "ALL"
  723.                 Endif
  724.  
  725.                                     
  726.         Set Chk = *($(CheckItemsOut), 1)     
  727.         Ifstr(i) $(Chk) == "ON"
  728.             Set TPValue = 1
  729.         Else
  730.             Set TPValue = 0
  731.         Endif
  732.  
  733.                 ui pop 1
  734. ;               goto nextstep
  735.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  736.                 set CommonStatus = STATUS_USERCANCEL
  737.                 Debug-Output "Action: exit. Bye."
  738.                 ui pop 1
  739.                 goto end
  740.     else
  741.                 ;
  742.                 ; Unknow command
  743.                 ;
  744.                 ui pop 1
  745.  
  746.  
  747.                 Debug-Output "Action: unknown. Bye."
  748.                 goto end
  749.     endif
  750.  
  751.  
  752.     Debug-Output " Combo list out "$(ComboListItemsOut)
  753.  
  754.  
  755. ;
  756. ;   If installing, go create the necessary keys;
  757. ;   if configuring, they're already open.
  758. ;
  759. skipoptions =+
  760.  
  761.     ifint $(OldVersionExisted) == $(TRUE)                               
  762.         ifstr(i) $(!NTN_InstallMode) == configure
  763.             goto writeparameters
  764.         endif                                                                
  765.     endif
  766.     StartWait
  767.     ;
  768.     ; Add Software Component
  769.     ;
  770.     ifint $(OldVersionExisted) == $(FALSE)
  771.  
  772.         ifstr(i) $(!NTN_InstallMode) == "install"
  773.            Ifstr(i) $(DoCopy) == "YES"
  774.  
  775.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  776.  
  777.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  778.                   Goto ShellCodeError
  779.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  780.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  781.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  782.                       goto ShellCodeError
  783.                   endif
  784.                   set Error = $($R0)
  785.                   Goto fatal
  786.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  787.                   Goto successful
  788.               Endif
  789.  
  790.               Set SrcDir = $($R1)
  791.  
  792.            Endif
  793.  
  794.            install "Install-Option"
  795.  
  796.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  797.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  798.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  799.                   goto ShellCodeError
  800.               endif
  801.               set Error = $($R0)
  802.               goto fatal
  803.            endif
  804.         endif
  805.  
  806.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  807.             $(ProductSoftwareName), +
  808.             $(ProductSoftwareName), +
  809.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  810.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  811.             $(NetEventDLL)
  812.  
  813.         Set OEM_ABANDON_SOFTWARE = TRUE
  814.  
  815.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  816.             Debug-Output "ShellCode error"
  817.             goto ShellCodeError
  818.         endif
  819.         ;
  820.         ;   At this point:
  821.         ;     $R1 contains the product version key handle;
  822.         ;     $R2 contains the NetRules subkey handle;
  823.         ;     $R3 contains the new Services key handle; and
  824.         ;     $R4 contains the Parameters key
  825.         ;     $R5 contains the Linkage Key
  826.         ;
  827.         set RegistryErrorIndex = $($R0)
  828.         set KeyProduct      = $($R1)
  829.         Set SoftNetRulesKey = $($R2)
  830.         CloseRegKey $($R3)
  831.         CloseRegKey $($R4)
  832.         CloseRegKey $($R5)
  833.  
  834.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  835.             EndWait
  836.             Debug-Output "Registry error: add software components"
  837.             CloseRegKey $(KeyProduct)
  838.             CloseRegKey $(SoftNetRulesKey)
  839.             goto fatalregistry
  840.         endif
  841.  
  842.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  843.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  844.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  845.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  846.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  847.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  848.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  849.  
  850.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  851.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  852.             Debug-Output "ShellCode error."
  853.             goto ShellCodeError
  854.         endif
  855.  
  856.         set RegistryErrorIndex = $($R0)
  857.  
  858.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  859.             EndWait
  860.             Debug-Output "Registry error: add value list."
  861.             CloseRegKey $(KeyProduct)
  862.             CloseRegKey $(SoftNetRulesKey)
  863.             goto fatalregistry
  864.         endif
  865.  
  866.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  867.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  868.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  869.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  870.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  871.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  872.  
  873.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  874.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  875.             Debug-Output "ShellCode error."
  876.             goto ShellCodeError
  877.         endif
  878.  
  879.         set RegistryErrorIndex = $($R0)
  880.  
  881.         CloseRegKey $(KeyProduct)
  882.         CloseRegKey $(SoftNetRulesKey)
  883.  
  884.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  885.             EndWait
  886.             Debug-Output "Resgitry error: add value list."
  887.             goto fatalregistry
  888.         endif
  889.     endif
  890. ;
  891. ;   Create the HARDWARE\Netcard region and its corresponding service
  892. ;
  893.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  894.  
  895.     ifint $($R4) != -1
  896.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  897.     endif
  898.  
  899.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  900.         Debug-Output "Cannot add hardware component"
  901.         goto ShellCodeError
  902.     endif
  903.  
  904.     set RegistryErrorIndex = $($R0)
  905.  
  906.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  907.         EndWait
  908.         Debug-Output "Registry error: add hardware component"
  909.         CloseRegKey $($R1)
  910.         CloseRegKey $($R2)
  911.         CloseRegKey $($R3)
  912.         goto fatalregistry
  913.     endif
  914.  
  915. ;
  916. ;   At this point:
  917. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  918. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  919. ;     $R3  Registry key handle for <service>\Parameters key
  920. ;     $R4  Adapter number assigned to adapter
  921. ;     $R5  Service name generated by combining svc name with adapter number
  922. ;
  923.     set KeyParameters = $($R3)
  924.     set KeyAdapterRules = $($R2)
  925.     set AdapterNumber = $($R4)
  926.  
  927.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  928.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  929.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  930.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  931.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  932.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  933.  
  934.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  935.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  936.         Debug-Output "ShellCode error"
  937.         goto ShellCodeError
  938.     endif
  939.  
  940.     CloseRegKey $($R1)
  941.  
  942.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  943.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  944.  
  945.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  946.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  947.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  948.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  949.  
  950.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  951.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  952.         Debug-Output "ShellCode error."
  953.         goto ShellCodeError
  954.     endif
  955.  
  956.     set RegistryErrorIndex = $($R0)
  957.  
  958.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  959.         EndWait
  960.         Debug-Output "Resgitry error: add value list."
  961.         CloseRegKey $(KeyParameters)
  962.         CloseRegKey $(KeyAdapterRules)
  963.         goto fatalregistry
  964.     endif
  965.  
  966.     CloseRegKey $(KeyAdapterRules)
  967.  
  968.     goto writeparameters
  969. ;
  970. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  971. ;
  972. writeparameters = +
  973.     Shell $(UtilityInf), GetBusTypeNum
  974.     set BusTypeNum = $($R1)
  975. ; Testing the BusNum. We are coding it to 0
  976.     set BusNumberValue = 0 ;
  977. ; End of BusNumber
  978.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  979.         Debug-Output "ShellCode error."
  980.         goto ShellCodeError
  981.     endif
  982.  
  983.     set DMAChannelValue = *($(DMAChannelValues), ~($(DMAChannelList),$(DMAChannelIndex)))
  984.  
  985.     set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueIndex)))
  986.  
  987.     set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
  988.  
  989.     set LED0Value = *($(LEDValues), ~($(LEDList),$(LED0Index)))
  990.     set LED1Value = *($(LEDValues), ~($(LEDList),$(LED1Index)))
  991.     set LED2Value = *($(LEDValues), ~($(LEDList),$(LED2Index)))
  992.     set LED3Value = *($(LEDValues), ~($(LEDList),$(LED3Index)))
  993.     set FullDuplexValue = *($(FullDuplexValues), ~($(FullDuplexList),$(FullDuplexIndex)))
  994.     set MediaTypeValue = *($(MediaTypeValues), ~($(MediaTypeList),$(MediaTypeIndex)))
  995.  
  996.   ; Ifint $(TPValue) != 0
  997.     set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  998.                         {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  999.                         {IOBaseAddress,  $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  1000.                         {BusNumber,  $(NoTitle),$(!REG_VT_DWORD),$(BusNumberValue)}}
  1001.  
  1002.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  1003.  
  1004.     CloseRegKey $(KeyParameters)
  1005.  
  1006.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1007.         Debug-Output "ShellCode error."
  1008.         goto ShellCodeError
  1009.     endif
  1010.  
  1011.     set RegistryErrorIndex = $($R0)
  1012.  
  1013.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1014.         Debug-Output "Registry error: Add value list"
  1015.         goto fatalregistry
  1016.     endif
  1017.  
  1018.     EndWait
  1019.  
  1020.     goto successful
  1021.  
  1022. ;-----------------------------------------------
  1023. ; Binding section
  1024. ;-----------------------------------------------
  1025. bindingadapter =+
  1026.     set Error = "Binding: Sorry, not yet implemented."
  1027.     goto fatal
  1028.  
  1029. ;-----------------------------------------------
  1030. ; Removeadapter section
  1031. ;-----------------------------------------------
  1032.  
  1033. removeadapter = +
  1034.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1035.         ; Remove Software Component
  1036.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1037.             $(ProductSoftwareName)
  1038.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1039.             Debug-Output "ShellCode error"
  1040.             goto ShellCodeError
  1041.         endif
  1042.  
  1043.         set RegistryErrorIndex = $($R0)
  1044.  
  1045.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1046.             goto fatalregistry
  1047.         endif
  1048.     else
  1049.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1050.             $(ProductSoftwareName), $(!NTN_RegBase)
  1051.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1052.             Debug-Output "ShellCode error"
  1053.             goto ShellCodeError
  1054.         endif
  1055.  
  1056.         set RegistryErrorIndex = $($R0)
  1057.  
  1058.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1059.             goto fatalregistry
  1060.         endif
  1061.     endif
  1062.  
  1063.     goto end
  1064.  
  1065. ;-----------------------------------------------
  1066. ; Upgrade Software section
  1067. ;-----------------------------------------------
  1068.  
  1069. UpgradeSoftware = +
  1070.     ;
  1071.     ; First determine whether we want to do upgrade or update for software
  1072.     ; or hardware component. Then we will determine whether the Mode is
  1073.     ; update or upgrade.
  1074.     ;
  1075.     ; If the same version of the product existed in the registry, we do
  1076.     ; update. Otherwise, we will do a upgrade
  1077.     ;
  1078.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1079.         ; Upgrade software component
  1080.         ;
  1081.         ; see whether the same version exist or not
  1082.         ;
  1083.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1084.  
  1085.         Ifstr $(KeyProduct) != $(KeyNull)
  1086.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1087.             set Version = *($(VersionInfo), 4)
  1088.  
  1089.             ;
  1090.             ; Update the binaries
  1091.             ;
  1092.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  1093.  
  1094.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1095.                 Debug-Output "ShellCode error"
  1096.                 goto ShellCodeError
  1097.             endif
  1098.  
  1099.             set !UG_Filename = $($R0)
  1100.  
  1101.             ifstr(i) $(!UG_Filename) != ""
  1102.                 install "Install-Update"
  1103.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1104.                     goto fatal
  1105.                 endif
  1106.             endif
  1107.  
  1108.             ; Upgrade the version number
  1109.             ;
  1110.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1111.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1112.  
  1113.             ;
  1114.             ; do nothing for update
  1115.             ;
  1116.             ifint $(Version) != $(ProductVersion)
  1117.                ;
  1118.                ; If the major version number is not the same,
  1119.                ; it is major upgrade. So let Upgrade the product
  1120.                ;
  1121.                ;
  1122.                ; make other upgrade change if necessary
  1123.                ;
  1124.             endif
  1125.             CloseRegKey $(KeyProduct)
  1126.         else
  1127.             ;
  1128.             ; Cannot Open software key, goto ERROR
  1129.             ;
  1130.             goto fatalregistry
  1131.         endif
  1132.     else
  1133.         ;
  1134.         ; upgrade/update hardware component
  1135.         ; There is no different between upgrade and update for hardware
  1136.         ; component
  1137.         ;
  1138.         ; 1. Get the Service Name
  1139.         ; 2. Change the NetRule section if necessary
  1140.         ;
  1141.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1142.               $(MAXIMUM_ALLOWED) NetworkCardKey
  1143.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1144.             ;
  1145.             ; Get Service name
  1146.             ;
  1147.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1148.             set ServiceName = *($(ServiceNameInfo), 4)
  1149.  
  1150.             ;
  1151.             ; Change the NetRule if necessary
  1152.             ;
  1153.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1154.                 $(MAXIMUM_ALLOWED) NetRuleKey
  1155.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1156.                 ;
  1157.                 ; Make the change....
  1158.                 ;
  1159.             else
  1160.                 ;
  1161.                 ; Error, cannot open net rules key
  1162.                 ;
  1163.                 goto fatalregistry
  1164.             endif
  1165.  
  1166.             CloseRegKey $(NetRules)
  1167.             CloseRegKey $(NetworkCardKey)
  1168.         else
  1169.             ;
  1170.             ; Error, cannot open network card key
  1171.             ;
  1172.             goto fatalregistry
  1173.         endif
  1174.         ;
  1175.         ; 3. Change the service section of the hardware. i.e.,
  1176.         ;    ParameterName change, value change, etc.
  1177.         ;
  1178.         OpenRegKey $(!REG_H_LOCAL) "" +
  1179.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  1180.               $(MAXIMUM_ALLOWED) ServiceKey
  1181.  
  1182.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  1183.             ;
  1184.             ; Get the ServiceKey to change the Start value
  1185.             ; or Type value. Or open Parameters key to
  1186.             ; change the hardware parameters if necessary.
  1187.             ;
  1188.             CloseRegKey $(ServiceKey)
  1189.         else
  1190.             ;
  1191.             ; Error, cannot open network card key
  1192.             ;
  1193.             goto fatalregistry
  1194.         endif
  1195.     endif
  1196.  
  1197.     goto end
  1198.     ;
  1199.     ; End of Upgrade Software
  1200.     ;
  1201.  
  1202. ;
  1203. ;  Escape hatches
  1204. ;
  1205. successful = +
  1206.     goto end
  1207.  
  1208. abandon = +
  1209.     ForListDo $(OEM_ABANDON_OPTIONS)
  1210.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1211.             $(ProductSoftwareName), $($)
  1212.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1213.             Debug-Output "ShellCode error"
  1214.             goto ShellCodeError
  1215.         endif
  1216.  
  1217.         set RegistryErrorIndex = $($R0)
  1218.  
  1219.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1220.             goto fatalregistry
  1221.         endif
  1222.     EndForListDo
  1223.  
  1224.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1225.         ; Remove Software Component
  1226.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1227.             $(ProductSoftwareName), FALSE
  1228.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1229.             Debug-Output "ShellCode error"
  1230.             goto ShellCodeError
  1231.         endif
  1232.  
  1233.         set RegistryErrorIndex = $($R0)
  1234.  
  1235.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1236.             goto fatalregistry
  1237.         endif
  1238.     endif
  1239.  
  1240.     goto end
  1241.  
  1242. ;
  1243. ; warning display
  1244. ;
  1245. warning = +
  1246.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1247.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1248.         goto ShellCodeError
  1249.     endif
  1250.     ifstr(i) $($R1) == "OK"
  1251.         goto $(to)
  1252.     else-ifstr(i) $($R1) == "CANCEL"
  1253.         goto $(from)
  1254.     else
  1255.         goto "end"
  1256.     endif
  1257. ;
  1258. ; non fatal error display
  1259. ;
  1260. nonfatalinfo = +
  1261.     Set Severity = STATUS
  1262.     Set CommonStatus = STATUS_USERCANCEL
  1263.     goto nonfatalmsg
  1264. nonfatal = +
  1265.     Set Severity = NONFATAL
  1266.     goto nonfatalmsg
  1267. nonfatalmsg = +
  1268.     ifstr(i) $(Error) == ""
  1269.         Set Severity = NONFATAL
  1270.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1271.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1272.             goto ShellCodeError
  1273.         endif
  1274.         set Error = $($R0)
  1275.     endif
  1276.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1277.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1278.         goto ShellCodeError
  1279.     endif
  1280.     ifstr(i) $($R1) == "OK"
  1281.         goto $(from)
  1282.     else
  1283.         goto "end"
  1284.     endif
  1285.  
  1286. ;
  1287. ;  Registry is broken
  1288. ;
  1289. fatalregistry = +
  1290.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1291.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1292.         goto ShellCodeError
  1293.     endif
  1294.     set Error = $($R0)
  1295.     goto fatal
  1296. ;
  1297. ;  Netcard detection failure
  1298. ;
  1299. fataldetect = +
  1300.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1301.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1302.         Debug-Output "ShellCode error: cannot get an error string."
  1303.         goto ShellCodeError
  1304.     endif
  1305.     set Error = $($R0)
  1306.     Goto fatal
  1307. ;
  1308. ; fatal error display
  1309. ;
  1310. fatal = +
  1311.     ifstr(i) $(Error) == ""
  1312.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1313.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1314.             goto ShellCodeError
  1315.         endif
  1316.         set Error = $($R0)
  1317.     endif
  1318.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1319.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1320.         goto ShellCodeError
  1321.     endif
  1322.  
  1323.     goto setfailed
  1324.  
  1325. ;
  1326. ;  Shelling error
  1327. ;
  1328. ShellCodeError = +
  1329.     set DlgType      = "MessageBox"
  1330.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1331.     set STF_MB_TEXT  = $(ShellCodeErrorText) 
  1332.     set STF_MB_TYPE  = 1
  1333.     set STF_MB_ICON  = 3
  1334.     set STF_MB_DEF   = 1
  1335.     ui start "Error Message"
  1336.     goto setfailed
  1337.  
  1338. setfailed = +
  1339.     set CommonStatus = STATUS_FAILED
  1340.     ;
  1341.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1342.     ;
  1343.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1344.         set OEM_ABANDON_ON = FALSE
  1345.         goto abandon
  1346.     endif
  1347.     goto end
  1348.  
  1349. end = +
  1350.     goto term
  1351.  
  1352. term = +
  1353.  
  1354.     Return $(CommonStatus)
  1355.  
  1356. [DebugConfiguration]
  1357.  
  1358.     Set InfName = "OEMNADAM.INF"
  1359.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1360.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1361.     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1362.     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1363.     Debug-Output $(InfName)" MemBaseAddrDec is "$(!p:MemBaseAddrDec)
  1364.     Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  1365.  
  1366.     return
  1367.  
  1368.  
  1369. ;***************************************************************
  1370. ;  INSTALL SECTIONS
  1371. ;***************************************************************
  1372. [Install-Option]
  1373.     set STF_VITAL = ""
  1374.  
  1375.     ifstr(i) $(AddCopy) == "YES"
  1376.  
  1377.         ;
  1378.         ; Add the files to the copy list
  1379.         ;
  1380.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1381.         ;      the other INF files
  1382.         ;
  1383.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1384.  
  1385.     endif
  1386.  
  1387.     ifstr(i) $(DoCopy) == "YES"
  1388.  
  1389.        ;
  1390.        ; Copy files in the copy list
  1391.        ;
  1392.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1393.        CopyFilesInCopyList
  1394.  
  1395.     endif
  1396.  
  1397.     Exit
  1398.  
  1399. [Install-Update]
  1400.    set STF_VITAL        = ""
  1401.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1402.    ;set STF_VERSION     = "YES"
  1403.  
  1404.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1405.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1406.  
  1407.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1408.    CopyFilesInCopyList
  1409.  
  1410.    exit
  1411.  
  1412. [Install-Helpfile]
  1413.    Debug-Output "At Install-Helpfile"
  1414.    set STF_VITAL        = ""
  1415.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1416.    ;set STF_VERSION     = "YES"
  1417.     set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1418.     
  1419.    AddSectionFilesToCopyList Files-hlp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1420.    CopyFilesInCopyList
  1421.  
  1422.    exit
  1423.  
  1424.  
  1425.  
  1426. [Install-Dll]
  1427.    set STF_VITAL        = ""
  1428.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1429.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1430.    CopyFilesInCopyList
  1431.    exit
  1432.  
  1433. [Source Media Descriptions]
  1434.     1  = "AT1700 Driver Disk" 
  1435.     2  = "Windows NT Setup CD-ROM Disk " 
  1436.    99  = "LMHOST disk"
  1437.  
  1438. [Signature]
  1439.     FileType = MICROSOFT_DRVLIB_FILE
  1440. [GetSignature]
  1441.     read-syms Signature
  1442.     return $(FileType)
  1443.  
  1444. [ProductType]
  1445. STF_PRODUCT  = Winnt
  1446. STF_PLATFORM = I386
  1447.  
  1448. [Files-Inf]
  1449. 1, oemsetup.inf,    SIZE=50000,     RENAME=$(!UG_Filename)
  1450.  
  1451. [Files-AT1700]
  1452. 1, at1700.SYS , SIZE=88888
  1453.  
  1454. [Files-Dll]
  1455. 1, at17dlg.dll,  SIZE=10000
  1456.  
  1457. [Files-hlp]
  1458. 1, AT1700.HLP, SIZE=12208
  1459.  
  1460. [LanguagesSupported]
  1461.     ENG
  1462.  
  1463. [OptionsTextENG]
  1464.     AT1700     = "ATI AT1700 Ethernet Adapter"
  1465.  
  1466. [FileConstantsENG]
  1467. ProCaption   = "Windows NT Setup"
  1468. ProCancel    = "Cancel"
  1469. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  1470.                "Are you sure you want to cancel copying files?"
  1471. ProCancelCap = "Network Setup Message"
  1472. ProText1     = "Copying:"
  1473. ProText2     = "To:"
  1474.  
  1475. FunctionTitle   = $(GenericAdapterName)" Card Setup"$(GenericInfVersion)
  1476.  
  1477. ProductSoftwareDescription = $(GenericDriverName)
  1478. ProductHardwareDescription = $(GenericAdapterName)
  1479. ProductHardwareAT1700Description="ATI AT1700 Driver"
  1480.  
  1481. ProductSoftwareTitle =       $(GenericDriverName)
  1482. ProductHardwareAT1700Title =       $(GenericAdapterName)
  1483.  
  1484. DialogDllName   = "at17dlg.dll"
  1485.  
  1486. IRQList  = ^(IRQChoices, 1)
  1487. IRQValues = ^(IRQChoices, 2)
  1488.  
  1489. IOBaseAddrList = ^(IOBaseAddrChoices, 1)
  1490. IOBaseAddrValues = ^(IOBaseAddrChoices, 2)
  1491.  
  1492. DMAChannelList = ^(DMAChannelChoices,1)
  1493. DMAChannelValues = ^(DMAChannelChoices,2)
  1494.  
  1495. LEDList = ^(LEDChoices,1)
  1496. LEDValues = ^(LEDChoices,2)
  1497.  
  1498. FullDuplexList = ^(FullDuplexChoices,1)
  1499. FullDuplexValues = ^(FullDuplexChoices,2)
  1500.  
  1501. MediaTypeList = ^(MediaTypeChoices,1)
  1502. MediaTypeValues = ^(MediaTypeChoices,2)
  1503.  
  1504. [DialogConstantsENG]
  1505. Help        = "&Help"
  1506. Exit        = "Cancel"
  1507. OK          = "&OK"
  1508. HelpContext = ""
  1509. Continue    = "Continue"
  1510. Cancel      = "&Cancel"
  1511.  
  1512. [MemoryMappedChoicesENG]
  1513. Map_1 = 1, "ON"
  1514. Map_2 = 0, "OFF"
  1515.  
  1516. [FileDependentDlgENG]
  1517.  
  1518. DlgText = "Please select values for the following fields:"
  1519.  
  1520. DlgType = "RadioCombination"
  1521. DlgTemplate = "AT1700"
  1522. Caption = $(FunctionTitle)
  1523.  
  1524.  
  1525. CBOptionsGreyed = {}
  1526. NotifyFields = {NO, NO}
  1527. HelpContext = 1
  1528.  
  1529. Combo1Label = "I/O Port:"
  1530. Combo2Label = "IRQ Number:"
  1531. Combo3Label = "DMA Number:"
  1532. ;Combo4Label = "&Full Duplex:"
  1533. Combo4Label = "Media Type:"
  1534. Combo5Label = "LED 0:"
  1535. Combo6Label = "LED 1:"
  1536. Combo7Label = "LED 2:"
  1537. Combo8Label = "LED 3:"
  1538.  
  1539. BigButton   = "More at1700 BS >>"
  1540.  
  1541. Combo1List = $(IOBaseAddrList)
  1542. Combo1Out  = $(IOBaseAddrValue)
  1543.  
  1544. Combo2List = $(IRQList)
  1545. Combo2Out  = $(IRQValue)
  1546.  
  1547. Combo3List = $(DMAChannelList)
  1548. Combo3Out  = $(DMAChannelValue)
  1549.  
  1550. ;Combo4List = $(FullDuplexList)
  1551. ;Combo4Out  = $(FullDuplexValue)
  1552.  
  1553. Combo4List = $(MediaTypeList)
  1554. Combo4Out  = $(MediaTypeValue)
  1555.  
  1556. Combo5List = $(LEDList)
  1557. Combo5Out  = $(LED0Value)
  1558.  
  1559. Combo6List = $(LEDList)
  1560. Combo6Out  = $(LED1Value)
  1561.  
  1562. Combo7List = $(LEDList)
  1563. Combo7Out  = $(LED2Value)
  1564.  
  1565. Combo8List = $(LEDList)
  1566. Combo8Out  = $(LED3Value)
  1567.  
  1568. ComboListItemsIn  = {Combo1List,Combo2List,Combo3List,Combo4List,Combo5List,Combo6List,Combo7List,Combo8List}
  1569. ComboListItemsOut = {Combo1Out,Combo2Out,Combo3Out,Combo4Out,Combo5Out,Combo6Out,Combo7Out,Combo8Out}
  1570.  
  1571. EditTextIn = ""
  1572. EditTextLim = ""
  1573.  
  1574. CheckBox1 = "&TP"
  1575.  
  1576. Group1 = "&Bus to scan"
  1577.  
  1578. Radio1 = "PCI"
  1579. Radio2 = "PNP"
  1580. Radio3 = "VESA"
  1581. Radio4 = "ISA"
  1582. Radio5 = "PCI1"
  1583. Radio6 = "PCI2"
  1584. Radio7 = "ALL"
  1585.  
  1586. [IRQChoices]
  1587. IRQ_1 = "3",3
  1588. IRQ_2 = "4",4
  1589. IRQ_3 = "5",5
  1590. IRQ_4 = "9",9
  1591. IRQ_5 = "10",10
  1592. IRQ_6 = "11",11
  1593. IRQ_7 = "12",12
  1594. IRQ_8 = "15",15
  1595.  
  1596. [IOBaseAddrChoices]
  1597. IOBase_1  = "0x240",576
  1598. IOBase_2  = "0x260",608
  1599. IOBase_3  = "0x280",640
  1600. IOBase_4  = "0x2A0",672
  1601. IOBase_5  = "0x300",768
  1602. IOBase_6  = "0x320",800
  1603. IOBase_7  = "0x340",832
  1604. IOBase_8  = "0x380",896
  1605.  
  1606. [DMAChannelChoices]
  1607. DMAChannel_1 = "3",3
  1608. DMAChannel_2 = "5",5
  1609. DMAChannel_3 = "6",6
  1610. DMAChannel_4 = "7",7
  1611.  
  1612. [LEDChoices]
  1613. LED_1 = "Default",65536
  1614. LED_2 = "0x0",0
  1615. LED_3 = "0x2",2
  1616. LED_4 = "0x4",4
  1617. LED_5 = "0x8",8
  1618. LED_6 = "0x10",16
  1619. LED_7 = "0x20",32
  1620. LED_8 = "0x30",48
  1621. LED_9 = "0x34",52
  1622. LED_10 = "0x40",64
  1623. LED_11 = "0xc0",192
  1624. LED_12 = "0x4088",16520
  1625. LED_13 = "0xb0",176
  1626. LED_14 = "0x21",129
  1627.  
  1628. [FullDuplexChoices]
  1629. FULLDUPLEX_1 = "Default",0
  1630. FULLDUPLEX_2 = "OFF",1
  1631. FULLDUPLEX_3 = "AUI",2
  1632. FULLDUPLEX_4 = "UTP",3
  1633.  
  1634. [MediaTypeChoices]
  1635. MEDIATYPE_1 = "TP",0
  1636. MEDIATYPE_2 = "Auto Select",1
  1637. ; MEDIATYPE_3 = "AUI/BNC/Fibre",2
  1638.